﻿@model IEnumerable<Web.Message>
           
<script type="text/javascript">
    $(function () {
        $("table.tablesorter").tablesorter();
    });
</script>

<table class="tablesorter">
    <thead>
        <tr>
            <th>
                Read
            </th>
            <th>
                @*@Ajax.ActionLink("Title", "SortByTitle", new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "listDiv" })*@
                Title
            </th>
            <th>
                @*@Ajax.ActionLink("Sender", "SortBySender", new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "listDiv" })*@
                Sender
            </th>
            <th>
                @*@Html.ActionLink("Time sent", "Inbox")*@
                Timesent
            </th>
            <th></th>
        </tr>
    </thead>

    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.opened)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Usersender.name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.timesent)
                </td>
                <td>
                    @Html.ActionLink("Read", "Details", new { id = item.id }) |
                    @Html.ActionLink("Archive", "Archivate", new { id = item.id }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.id })
                </td>
            </tr>
        }
    </tbody>
</table>
